import request from '@/utils/request'
//获取角色列表
export const getRoleList = data => {
  return request({
    url: '/admin/system/sysRole/roleList',
    method: 'post',
    data: data,
  })
}
// 添加角色
export const addRole = data => {
  return request({
    url: '/admin/system/sysRole/add',
    method: 'post',
    data: data,
  })
}
//编辑角色
export const editRole = data => {
  return request({
    url: '/admin/system/sysRole/edit',
    method: 'put',
    data: data,
  })
}
// 删除角色
export const deleteRole = id => {
  return request({
    url: `/admin/system/sysRole/delete/${id}`,
    method: 'delete',
  })
}
//查询所有菜单和已经分配过的菜单
export const getAssignedMenuList = id => {
  return request({
    url: `/admin/system/sysRole/queryAssignedMenu/${id}`,
    method: 'get',
  })
}
//保存角色菜单绑定关系
export const saveRoleMenu = data => {
  return request({
    url: '/admin/system/sysRole/assignMenu',
    method: 'post',
    data: data,
  })
}
